package com.example.mytestapplication;

import android.widget.Toast;

import org.simple.eventbus.EventBus;

import java.net.UnknownHostException;

import rx.Observer;

/**
 * Created by wei on 2017/8/15.
 */

public abstract class NetworkObserver<T> implements Observer<T>{

    @Override
    public void onError(Throwable e) {
        if (e instanceof UnknownHostException) {
            EventBus.getDefault().post(System.currentTimeMillis()+"","UNCONNECT_NETWORK");
        }
        onError2(e);
    }

    public abstract void onError2(Throwable e);

}
